I'm plotting the relative magnitude of the error bars of different sources of uncertainty in the emu inference.
In [1]:
    
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
    
In [2]:
    
import numpy as np
    
In [3]:
    
%%bash
ls /home/users/swmclau2/Git/pearce/bin/mcmc/*scov*.npy -lt
    
    
In [4]:
    
boxno, realization = 3, 1
    
In [5]:
    
shot_cov = np.loadtxt('/home/users/swmclau2/Git/pearce/bin/mcmc/xi_gg_shot_cov_true_%d%d.npy'%(boxno, realization))
jk_cov = np.loadtxt('/home/users/swmclau2/Git/pearce/bin/mcmc/xi_gg_cov_true_jk_%d%d.npy'%(boxno, realization))
sample_cov = np.loadtxt('/home/users/swmclau2/Git/pearce/bin/mcmc/xigg_scov.npy')
data_cov = np.loadtxt('xigg_ycov.npy')
    
In [6]:
    
#TODO add emu1 cov,
    
In [11]:
    
last_bar = np.zeros((shot_cov.shape[0],))
i = 0
for covmat, label in zip([shot_cov, jk_cov], ['Shot', 'JK']):
    #if i == 2:
    #    break
    #i+=1
    errs = np.sqrt(np.diag(covmat))
    print label, errs
    if label == 'Training':
        plt.bar(np.array(range(shot_cov.shape[0])), errs, bottom = last_bar, label = label, color = 'r')
    else:
        plt.bar(np.array(range(shot_cov.shape[0])), errs, bottom = last_bar, label = label)
    last_bar = errs
    
plt.legend(loc = 'best')
plt.yscale('log')
plt.show()
    
    
    
In [ ]:
    
    
In [ ]: